﻿using System;
using NUnit.Framework;

namespace Alabra.ExtensionMethods.ExtensionMethodsTest
{
    public class DateTimeExtensionFirstDayOfMonthTest
    {
        [Test]
        public void WhenDateTimeIsFirtsDayOfMonthReturnFirtsDayOfMonth()
        {
            var firtsDayJanuary = new DateTime(2010, 01, 01);
            
            Assert.AreEqual(firtsDayJanuary, firtsDayJanuary.FirstDayOfMonth());
        }
        [Test]
        public void WhenDateTimeIsOtherDayOfMonthReturnFirtsDayOfMonth()
        {
            var firtsDayJanuary = new DateTime(2010, 01, 01);
            var otherDayJanuary = new DateTime(2010, 01, 20);

            Assert.AreEqual(firtsDayJanuary, otherDayJanuary.FirstDayOfMonth());
        }
        [Test]
        public void WhenDateTimeIsEndDayOfMonthReturnFirtsDayOfMonth()
        {
            var firtsDayJanuary = new DateTime(2010, 01, 01);
            var lastDayJanuary = new DateTime(2010, 01, 31);

            Assert.AreEqual(firtsDayJanuary, lastDayJanuary.FirstDayOfMonth());
        }
    }
}
